#include <iostream>
#include <vector>
#include <algorithm>
#define endl '\n'
#define int long long
#define pii pair<int, int>
using namespace std;

// 已知
int n;
struct p
{
    int a, b, r;
};
p a[100005];

// 未知

void input()
{
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i].a;
        a[i].b = i;
    }
}
void solve()
{
    sort(a + 1, a + n + 1, [](p a, p b)
         { return a.a > b.a; });
    int r = 1;
    a[n].r = 1;
    for (int i = 1; i <= n; ++i)
    {
        if (a[i].a != a[i - 1].a)
        {
            // cout<<i<<":"<<a[i].a<<' '<<a[i-1].a<<endl;
            r = i;
        }
        a[i].r = r;
    }
}
void output()
{
    sort(a + 1, a + n + 1, [](p a, p b)
         { return a.b < b.b; });
    for (int i = 1; i <= n; i++)
    {
        cout << a[i].r << '\n';
    }
}
signed main()
{
    input();
    solve();
    output();
    return 0;
}